﻿using System;
using jQueryNET;
using System.Web.UI;

public partial class Grid : Page
{
	[Serializable]
	internal class DataSourceParams
	{
		public string table { get; set; }
	}

	protected void Page_Load(object sender, EventArgs e)
	{

		var header = new HeaderSection();
		var row = new HeaderRow();
		row.Cells.Add(new HeaderCell { HAlign = EHAlign.Center, Name = "Test", VAlign = EVAlign.Bottom, Width = 120, ColSpan = 2 });
		row.Cells.Add(new HeaderCell { HAlign = EHAlign.Center, Name = "Test1", VAlign = EVAlign.Bottom, Width = 40, RowSpan = 2, Field = "Address" });
		row.Cells.Add(new HeaderCell { HAlign = EHAlign.Center, Name = "Test1", VAlign = EVAlign.Bottom, Width = 140, RowSpan = 2, Field = "Address" });
		row.Cells.Add(new HeaderCell { HAlign = EHAlign.Center, Name = "Test1", VAlign = EVAlign.Bottom, Width = 140, RowSpan = 2, Field = "Address" });
		row.Cells.Add(new HeaderCell { HAlign = EHAlign.Center, Name = "Test1", VAlign = EVAlign.Bottom, Width = 140, RowSpan = 2, Field = "Address" });
		row.Cells.Add(new HeaderCell { HAlign = EHAlign.Center, Name = "Test1", VAlign = EVAlign.Bottom, Width = 140, RowSpan = 2, Field = "Address" });
		row.Cells.Add(new HeaderCell { HAlign = EHAlign.Center, Name = "Test1", VAlign = EVAlign.Bottom, Width = 140, RowSpan = 2, Field = "Address" });
		row.Cells.Add(new HeaderCell { HAlign = EHAlign.Center, Name = "Test1", VAlign = EVAlign.Bottom, Width = 140, RowSpan = 2, Field = "Address" });
		header.Rows.Add(row);

		row = new HeaderRow();
		row.Cells.Add(new HeaderCell { HAlign = EHAlign.Center, Name = "Name", VAlign = EVAlign.Bottom, Width = 40, Field = "CompanyName" });
		row.Cells.Add(new HeaderCell { Name = "Id", Width = 80, Field = "CustomerID" });
		header.Rows.Add(row);

		Grid1.Header = header;
		Grid1.RowInPage = 6;
        DataSource1.Parameters = new DataSourceParams() { table="Customer"};

	}
}
